.class public Lcom/brixd/niceapp/activity/fragment/DownloadDialog;
.super Landroid/app/Dialog;
.source "DownloadDialog.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;,
        Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;,
        Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;,
        Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;
    }
.end annotation


# instance fields
.field private mAdapter:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

.field private mAppId:I

.field private mAppSize:Ljava/lang/String;

.field private mDirectDownloadWithoutShowDialog:Z

.field private mDownloadItems:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;",
            ">;"
        }
    .end annotation
.end field

.field private mDownloadUrls:Ljava/util/HashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private mGridView:Landroid/widget/GridView;

.field private mMetrics:Landroid/util/DisplayMetrics;

.field private mOnDownloadTypeClickEvent:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;

.field private mPackageName:Ljava/lang/String;

.field private mTextAppSize:Landroid/widget/TextView;

.field private mTitle:Ljava/lang/String;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V
    .registers 7
    .param p1, "context"    # Landroid/content/Context;
    .param p2, "appSize"    # Ljava/lang/String;
    .param p3, "title"    # Ljava/lang/String;
    .param p4, "packageName"    # Ljava/lang/String;
    .param p5, "appId"    # I

    .prologue
    .line 50
    const v0, 0x7f0d001a

    invoke-direct {p0, p1, v0}, Landroid/app/Dialog;-><init>(Landroid/content/Context;I)V

    .line 42
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDirectDownloadWithoutShowDialog:Z

    .line 51
    iput-object p2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAppSize:Ljava/lang/String;

    .line 52
    iput-object p3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mTitle:Ljava/lang/String;

    .line 53
    iput-object p4, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mPackageName:Ljava/lang/String;

    .line 54
    iput p5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAppId:I

    .line 55
    invoke-direct {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->init()V

    .line 56
    return-void
.end method

.method static synthetic access$100(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;)Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    .prologue
    .line 35
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mOnDownloadTypeClickEvent:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;

    return-object v0
.end method

.method static synthetic access$200(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;)Ljava/lang/String;
    .registers 2
    .param p0, "x0"    # Lcom/brixd/niceapp/activity/fragment/DownloadDialog;

    .prologue
    .line 35
    iget-object v0, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mPackageName:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$300(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;Ljava/lang/String;I)V
    .registers 3
    .param p0, "x0"    # Lcom/brixd/niceapp/activity/fragment/DownloadDialog;
    .param p1, "x1"    # Ljava/lang/String;
    .param p2, "x2"    # I

    .prologue
    .line 35
    invoke-direct {p0, p1, p2}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->directDownload(Ljava/lang/String;I)V

    return-void
.end method

.method private directDownload(Ljava/lang/String;I)V
    .registers 11
    .param p1, "url"    # Ljava/lang/String;
    .param p2, "appId"    # I

    .prologue
    .line 148
    :try_start_0
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mTitle:Ljava/lang/String;

    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f0c0062

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    const-string v4, "nice_apps"

    const/4 v5, 0x1

    move-object v0, p1

    move v1, p2

    invoke-static/range {v0 .. v5}, Lcom/brixd/niceapp/util/DownloadUtils;->startDownload(Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)V

    .line 150
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f0c0107

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;II)Landroid/widget/Toast;

    move-result-object v0

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V
    :try_end_24
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_24} :catch_25

    .line 160
    :goto_24
    return-void

    .line 151
    :catch_25
    move-exception v6

    .line 153
    .local v6, "e":Ljava/lang/Exception;
    :try_start_26
    new-instance v7, Landroid/content/Intent;

    invoke-direct {v7}, Landroid/content/Intent;-><init>()V

    .line 154
    .local v7, "intent":Landroid/content/Intent;
    const-string v0, "android.intent.action.VIEW"

    invoke-virtual {v7, v0}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;

    .line 155
    invoke-static {p1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v0

    invoke-virtual {v7, v0}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 156
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0, v7}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
    :try_end_3e
    .catch Ljava/lang/Exception; {:try_start_26 .. :try_end_3e} :catch_3f

    goto :goto_24

    .line 157
    .end local v7    # "intent":Landroid/content/Intent;
    :catch_3f
    move-exception v0

    goto :goto_24
.end method

.method private init()V
    .registers 9

    .prologue
    const/4 v7, 0x1

    const/high16 v6, 0x43a00000

    .line 59
    const v5, 0x7f030048

    invoke-virtual {p0, v5}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->setContentView(I)V

    .line 61
    const v5, 0x7f0a00a4

    invoke-virtual {p0, v5}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->findViewById(I)Landroid/view/View;

    move-result-object v1

    .line 62
    .local v1, "contentView":Landroid/view/View;
    invoke-virtual {v1}, Landroid/view/View;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v2

    .line 63
    .local v2, "params":Landroid/view/ViewGroup$LayoutParams;
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-virtual {v5}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v5

    invoke-virtual {v5}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v5

    iput-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mMetrics:Landroid/util/DisplayMetrics;

    .line 64
    iget-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mMetrics:Landroid/util/DisplayMetrics;

    iget v4, v5, Landroid/util/DisplayMetrics;->xdpi:F

    .line 66
    .local v4, "xdpi":F
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getWindow()Landroid/view/Window;

    move-result-object v5

    invoke-virtual {v5}, Landroid/view/Window;->getAttributes()Landroid/view/WindowManager$LayoutParams;

    move-result-object v3

    .line 67
    .local v3, "winParams":Landroid/view/WindowManager$LayoutParams;
    const/high16 v5, 0x3f000000

    iput v5, v3, Landroid/view/WindowManager$LayoutParams;->dimAmount:F

    .line 68
    const/16 v5, 0x11

    iput v5, v3, Landroid/view/WindowManager$LayoutParams;->gravity:I

    .line 69
    iget v5, v3, Landroid/view/WindowManager$LayoutParams;->flags:I

    or-int/lit8 v5, v5, 0x2

    iput v5, v3, Landroid/view/WindowManager$LayoutParams;->flags:I

    .line 71
    cmpl-float v5, v4, v6

    if-lez v5, :cond_99

    .line 72
    const/high16 v5, 0x43a80000

    iget-object v6, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mMetrics:Landroid/util/DisplayMetrics;

    invoke-static {v7, v5, v6}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v5

    float-to-int v5, v5

    iput v5, v2, Landroid/view/ViewGroup$LayoutParams;->width:I

    .line 77
    :goto_4b
    const v5, 0x7f0a010a

    invoke-virtual {p0, v5}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/TextView;

    iput-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mTextAppSize:Landroid/widget/TextView;

    .line 79
    const-string v5, "0.0M"

    iget-object v6, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAppSize:Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_a3

    .line 80
    const v5, 0x7f0c0014

    iget-object v6, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAppSize:Ljava/lang/String;

    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v7

    invoke-static {v5, v6, v7}, Lcom/zuiapps/suite/utils/string/StringBundleUtil;->resolveString(ILjava/lang/String;Landroid/content/Context;)Ljava/lang/String;

    move-result-object v0

    .line 81
    .local v0, "appSizeStr":Ljava/lang/String;
    iget-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mTextAppSize:Landroid/widget/TextView;

    invoke-virtual {v5, v0}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 86
    .end local v0    # "appSizeStr":Ljava/lang/String;
    :goto_72
    const v5, 0x7f0a010b

    invoke-virtual {p0, v5}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/GridView;

    iput-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mGridView:Landroid/widget/GridView;

    .line 87
    new-instance v5, Ljava/util/ArrayList;

    invoke-direct {v5}, Ljava/util/ArrayList;-><init>()V

    iput-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadItems:Ljava/util/List;

    .line 88
    new-instance v5, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v6

    iget-object v7, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadItems:Ljava/util/List;

    invoke-direct {v5, p0, v6, v7}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;-><init>(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;Landroid/content/Context;Ljava/util/List;)V

    iput-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAdapter:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    .line 89
    iget-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mGridView:Landroid/widget/GridView;

    iget-object v6, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAdapter:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$GridAdapter;

    invoke-virtual {v5, v6}, Landroid/widget/GridView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 90
    return-void

    .line 74
    :cond_99
    iget-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mMetrics:Landroid/util/DisplayMetrics;

    invoke-static {v7, v6, v5}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v5

    float-to-int v5, v5

    iput v5, v2, Landroid/view/ViewGroup$LayoutParams;->width:I

    goto :goto_4b

    .line 83
    :cond_a3
    iget-object v5, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mTextAppSize:Landroid/widget/TextView;

    const/16 v6, 0x8

    invoke-virtual {v5, v6}, Landroid/widget/TextView;->setVisibility(I)V

    goto :goto_72
.end method


# virtual methods
.method public setDownloadUrls(Ljava/util/HashMap;)V
    .registers 8
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/HashMap",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    .local p1, "downloadUrls":Ljava/util/HashMap;, "Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    const/4 v5, 0x3

    const/4 v3, 0x0

    const/4 v4, 0x1

    .line 93
    iput-object p1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    .line 95
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    invoke-virtual {v1}, Ljava/util/HashMap;->size()I

    move-result v1

    if-ne v1, v4, :cond_1a

    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    const-string v2, "Direct"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1a

    .line 96
    iput-boolean v4, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDirectDownloadWithoutShowDialog:Z

    .line 144
    :goto_19
    return-void

    .line 98
    :cond_1a
    const/4 v1, 0x0

    iput-boolean v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDirectDownloadWithoutShowDialog:Z

    .line 100
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    const-string v2, "GooglePlay"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_4a

    .line 101
    new-instance v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    invoke-direct {v0, p0, v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;-><init>(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;Lcom/brixd/niceapp/activity/fragment/DownloadDialog$1;)V

    .line 102
    .local v0, "item":Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;
    const v1, 0x7f02011f

    iput v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->bgResId:I

    .line 103
    sget-object v1, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;->GooglePlay:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    iput-object v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->type:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    .line 104
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    const-string v2, "GooglePlay"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    iput-object v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->url:Ljava/lang/String;

    .line 105
    iget v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAppId:I

    iput v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->appId:I

    .line 106
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadItems:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 109
    .end local v0    # "item":Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;
    :cond_4a
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    const-string v2, "Wandoujia"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_77

    .line 110
    new-instance v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    invoke-direct {v0, p0, v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;-><init>(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;Lcom/brixd/niceapp/activity/fragment/DownloadDialog$1;)V

    .line 111
    .restart local v0    # "item":Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;
    const v1, 0x7f020128

    iput v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->bgResId:I

    .line 112
    sget-object v1, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;->Wandoujia:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    iput-object v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->type:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    .line 113
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    const-string v2, "Wandoujia"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    iput-object v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->url:Ljava/lang/String;

    .line 114
    iget v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAppId:I

    iput v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->appId:I

    .line 115
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadItems:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 118
    .end local v0    # "item":Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;
    :cond_77
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v1

    const-string v2, "com.xiaomi.market"

    invoke-static {v1, v2}, Lcom/zuiapps/suite/utils/app/AppUtil;->isAppInstalled(Landroid/content/Context;Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_9a

    .line 119
    new-instance v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    invoke-direct {v0, p0, v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;-><init>(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;Lcom/brixd/niceapp/activity/fragment/DownloadDialog$1;)V

    .line 120
    .restart local v0    # "item":Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;
    const v1, 0x7f02012c

    iput v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->bgResId:I

    .line 121
    sget-object v1, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;->Xiaomi:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    iput-object v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->type:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    .line 122
    iget v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAppId:I

    iput v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->appId:I

    .line 123
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadItems:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 126
    .end local v0    # "item":Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;
    :cond_9a
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    const-string v2, "Direct"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_c7

    .line 127
    new-instance v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;

    invoke-direct {v0, p0, v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;-><init>(Lcom/brixd/niceapp/activity/fragment/DownloadDialog;Lcom/brixd/niceapp/activity/fragment/DownloadDialog$1;)V

    .line 128
    .restart local v0    # "item":Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;
    const v1, 0x7f02011c

    iput v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->bgResId:I

    .line 129
    sget-object v1, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;->Direct:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    iput-object v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->type:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    .line 130
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    const-string v2, "Direct"

    invoke-virtual {v1, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/lang/String;

    iput-object v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->url:Ljava/lang/String;

    .line 131
    iget v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mAppId:I

    iput v1, v0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;->appId:I

    .line 132
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadItems:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 135
    .end local v0    # "item":Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadItem;
    :cond_c7
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadItems:Ljava/util/List;

    invoke-interface {v1}, Ljava/util/List;->size()I

    move-result v1

    if-ge v1, v5, :cond_ed

    .line 136
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mGridView:Landroid/widget/GridView;

    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadItems:Ljava/util/List;

    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v2

    invoke-virtual {v1, v2}, Landroid/widget/GridView;->setNumColumns(I)V

    .line 137
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mGridView:Landroid/widget/GridView;

    invoke-virtual {v1}, Landroid/widget/GridView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v1

    const/high16 v2, 0x43480000

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mMetrics:Landroid/util/DisplayMetrics;

    invoke-static {v4, v2, v3}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v2

    float-to-int v2, v2

    iput v2, v1, Landroid/view/ViewGroup$LayoutParams;->width:I

    goto/16 :goto_19

    .line 139
    :cond_ed
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mGridView:Landroid/widget/GridView;

    invoke-virtual {v1, v5}, Landroid/widget/GridView;->setNumColumns(I)V

    .line 140
    iget-object v1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mGridView:Landroid/widget/GridView;

    invoke-virtual {v1}, Landroid/widget/GridView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v1

    const/high16 v2, 0x438c0000

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mMetrics:Landroid/util/DisplayMetrics;

    invoke-static {v4, v2, v3}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v2

    float-to-int v2, v2

    iput v2, v1, Landroid/view/ViewGroup$LayoutParams;->width:I

    goto/16 :goto_19
.end method

.method public setOnDownloadTypeClickEvent(Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;)V
    .registers 2
    .param p1, "onDownloadTypeClickEvent"    # Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;

    .prologue
    .line 195
    iput-object p1, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mOnDownloadTypeClickEvent:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;

    .line 196
    return-void
.end method

.method public showOrDownload(I)V
    .registers 6
    .param p1, "appId"    # I

    .prologue
    .line 168
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    if-eqz v2, :cond_c

    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    invoke-virtual {v2}, Ljava/util/HashMap;->size()I

    move-result v2

    if-nez v2, :cond_d

    .line 192
    :cond_c
    :goto_c
    return-void

    .line 172
    :cond_d
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    const-string v3, "UMENG_CHANNEL"

    invoke-static {v2, v3}, Lcom/zuiapps/suite/utils/app/AppUtil;->getAppMetaData(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 173
    .local v1, "channel":Ljava/lang/String;
    const-string v2, "meizu"

    invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_63

    invoke-static {}, Lcom/zuiapps/suite/utils/device/DeviceUtil;->isMeizu()Z

    move-result v2

    if-eqz v2, :cond_63

    .line 174
    new-instance v0, Landroid/content/Intent;

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v0, v2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 175
    .local v0, "appIntent":Landroid/content/Intent;
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "mstore:http://app.meizu.com/phone/apps/"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    iget-object v3, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    invoke-static {v3}, Lcom/brixd/niceapp/util/CommonUtils;->getAppPackageName(Ljava/util/HashMap;)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setData(Landroid/net/Uri;)Landroid/content/Intent;

    .line 176
    const-string v2, "com.meizu.mstore"

    invoke-virtual {v0, v2}, Landroid/content/Intent;->setPackage(Ljava/lang/String;)Landroid/content/Intent;

    .line 177
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-static {v2, v0}, Lcom/zuiapps/suite/utils/intent/IntentUtil;->isIntentAvailable(Landroid/content/Context;Landroid/content/Intent;)Z

    move-result v2

    if-eqz v2, :cond_63

    .line 178
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v2, v0}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V

    goto :goto_c

    .line 185
    .end local v0    # "appIntent":Landroid/content/Intent;
    :cond_63
    iget-boolean v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDirectDownloadWithoutShowDialog:Z

    if-eqz v2, :cond_7f

    .line 186
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mOnDownloadTypeClickEvent:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;

    sget-object v3, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;->Direct:Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;

    invoke-interface {v2, v3}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog$OnDownloadTypeClickEvent;->onDownloadTypeClick(Lcom/brixd/niceapp/activity/fragment/DownloadDialog$DownloadType;)Z

    move-result v2

    if-nez v2, :cond_c

    .line 187
    iget-object v2, p0, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->mDownloadUrls:Ljava/util/HashMap;

    const-string v3, "Direct"

    invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-direct {p0, v2, p1}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->directDownload(Ljava/lang/String;I)V

    goto :goto_c

    .line 190
    :cond_7f
    invoke-virtual {p0}, Lcom/brixd/niceapp/activity/fragment/DownloadDialog;->show()V

    goto :goto_c
.end method
